package com.xn2001.pattern;

import java.io.Serializable;

/**
 * @author 乐心湖
 * @version 1.0
 * @date 2021/11/9 21:35
 */

public class Singleton5 implements Serializable {
    private Singleton5() {
        System.out.println("private Singleton5()");
    }
    private static class Holder {
        static Singleton5 INSTANCE = new Singleton5();
    }
    public static Singleton5 getInstance() {
        return Holder.INSTANCE;
    }
    public static void otherMethod() {
        System.out.println("otherMethod()");
    }
}
